# Maintainer: Xyne <ca dot archlinux at xyne, backwards>
# Contributor: Daenyth <Daenyth+Arch at gmail dot com>
# Contributor: Chris Winter <twidds at gmail dot com>

pkgname=fdupes
pkgver=2.2.1
pkgrel=2
# Version changed from 1.51 to 1.6.1
epoch=1
pkgdesc="a program for identifying or deleting duplicate files residing within specified directories"
arch=('loong64' 'x86_64')
url="https://github.com/adrianlopezroche/fdupes"
license=(custom)
depends=(glibc ncurses pcre2)
makedepends=(git)
source=(
  https://github.com/adrianlopezroche/fdupes/releases/download/v${pkgver}/fdupes-${pkgver}.tar.gz
  LICENSE
)
# Alternatively
# source=(git://github.com/adrianlopezroche/fdupes.git#tag=$pkgname-$pkgver LICENSE)
sha512sums=('4911d2f776480691e7bd7045c181d49159add5b479188b05f0878a7af365cee0e430093e71ff172c04b876c58efc3be0f24c9d25f0cdebf1c869931175bc8608'
            '2b006d12a4d0ffad519fc96d3bf58d11812dc30aa175d07f1966885d7eb096fa8bb5b1e8915d2ff8a010c6826b34b4067f7aac1cc5d5338473a806db3b130355')

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr
  make PREFIX=/usr
}

package(){
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  # cd $pkgname-$pkgver
  # # This works on the master branch but not for the 1.51 tag.
  # # install -d "$pkgdir"/usr/{share/man/man1,bin} # remnant from old PKGBUILD
  # #make PREFIX=/usr DESTDIR="$pkgdir" install
  # install -Dm755 fdupes "$pkgdir/usr/bin/fdupes"
  # install -Dm644 fdupes.1 "$pkgdir/usr/share/man/man1/fdupes.1"
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
}

# vim: set ts=2 sw=2 et:
